#ifndef __SP_ACCEPTOR_H_INCLUDED__
#define __SP_ACCEPTOR_H_INCLUDED__

#include "thread.h"
#include "fd.h"

class IoHandler;

class Acceptor
{
	public:
		Acceptor();

		static void AcceptorRoutine(void* acceptor);

		bool init(IoHandler* pIoHandler);

		bool startListen(const char* szIp, int port);

	private:
		thread worker;
		IoHandler* ioHandler;
		int kq;
		fd_t acceptSocket;
};

#endif
